<template>
	<view>
		<view style="padding: 20rpx 30rpx;" >
			<view>
				<uni-row>
					<uni-col :span="12">
						头像
					</uni-col>
					<uni-col :span="11" style="text-align: right;">
						<image src="/static/myPlace/head_img.png" style="width: 60rpx; height: 60rpx;"></image> 
					</uni-col>
					<uni-col :span="1" style="line-height: 60rpx;">
						<uni-icons type="forward" size="15"></uni-icons>	
					</uni-col>
				</uni-row>
			</view>
			<view>
				<uni-row>
					<uni-col :span="12">
						用户ID
					</uni-col>
					<uni-col :span="11" style="text-align: right; line-height: 60rpx;">
						<text v-text="this.userId">1</text>
					</uni-col>
					<uni-col :span="1" style="line-height: 60rpx;">
						<uni-icons type="forward" size="15"></uni-icons>	
					</uni-col>
				</uni-row>
			</view>
			<view>
				<uni-row>
					<uni-col :span="12">
						昵称
					</uni-col>
					<uni-col :span="11" style="text-align: right; line-height: 60rpx;">
						<text v-text="user.nickName">未填写</text>
					</uni-col>
					<uni-col :span="1" style="line-height: 60rpx;">
						<uni-icons type="forward" size="15"></uni-icons>	
					</uni-col>
				</uni-row>
			</view>
			<view>
				<uni-row>
					<uni-col :span="12">
						性别
					</uni-col>
					<uni-col :span="11" style="text-align: right; line-height: 60rpx;">
						<text v-if="user.sex==1">男</text>
						<text v-else-if="user.sex==2">女</text>
						<text v-else>未填写</text>
					</uni-col>
					<uni-col :span="1" style="line-height: 60rpx;">
						<uni-icons type="forward" size="15"></uni-icons>	
					</uni-col>
				</uni-row>
			</view>
			<view>
				<uni-row>
					<uni-col :span="12">
						生日
					</uni-col>
					<uni-col :span="11" style="text-align: right; line-height: 60rpx;">
						<text v-text="user.birthday">未填写</text>
					</uni-col>
					<uni-col :span="1" style="line-height: 60rpx;">
						<uni-icons type="forward" size="15"></uni-icons>	
					</uni-col>
				</uni-row>
			</view>
			<view>
				<uni-row>
					<uni-col :span="12">
						职业
					</uni-col>
					<uni-col :span="11" style="text-align: right; line-height: 60rpx;">
						<text v-text="user.occupation">未填写</text>
					</uni-col>
					<uni-col :span="1" style="line-height: 60rpx;">
						<uni-icons type="forward" size="15"></uni-icons>	
					</uni-col>
				</uni-row>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				user:{}
			}
		},
		onLoad() {
			//加载个人信息
			uni.request({
				url: 'http://120.46.197.40:8080/api/user/getUserInfo',
				method: 'GET',
				data: {
					userId: this.userId
				},
				header: {
					'content-type': 'application/x-www-form-urlencoded'
				},
				success: (res) => {
					
					this.user = res.data.data;
					this.user.birthday=this.user.birthday.substring(0,10);
					//this.text = 'request success';
				}
			});
		},
		methods: {
			
		}
	}
</script>

<style>

</style>
